<template>
	<view>
		<view class="p-12 flex flex-x-space-between flex-wrap grid-gap-10">
			<view style="width: 48%;" class="rounded-8 h-220 bg-white position-relative overflow-hidden" v-for="(item,index) in list">
				<view class="position-absolute px-8 py-3 fs-12 text-white right-0 top-0 box rounded-bottom-left-8">{{item.cert.name}}</view>
				<image :src="item.image" class="w-p-100 h-180" mode="aspectFill" @click="$tool.previewImage(item.image)"></image>
				<view class="text-center">
					<text class="fw-600 fs-12">{{item.testPaper.name}}</text>
				</view>
			</view>
		</view>
	</view>
</template>

<script setup>
	import { ref } from 'vue';
	import { onLoad } from '@dcloudio/uni-app'
	import { $http,$tool } from '@/utils';
	const list = ref([])
	onLoad(() => {
		getList()
	})
	const getList = () => {
		$http.get('Cert/getList').then(res => {
			list.value = res.data
		})
	}
</script>

<style>
	.box {
		background-color: rgba(0, 0, 0, 0.6);
	}
</style>